package com.common.retrofit.bearusermethod;

import com.common.cons.Constans;
import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.bean.MyShareBean;
import com.common.retrofit.service.BearUserService;
import com.common.utils.SortUtils;

import rx.Observable;
import rx.Subscriber;

public class GetShareDataMineMethods extends BaseMethods {

    private static GetShareDataMineMethods m_ins = null;

    public static GetShareDataMineMethods getInstance() {
        if (m_ins == null) {
            synchronized (GetShareDataMineMethods.class) {
                if (m_ins == null) {
                    m_ins = new GetShareDataMineMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Api/Goods/";
    }

    private BearUserService initService() {
        return getRetrofit().create(BearUserService.class);
    }


    public void     share     (Subscriber<MyShareBean> subscriber , int uid, String  hashid) {
        String time  = System.currentTimeMillis()+"" ;
        Observable observable = initService().share(time,SortUtils.getMyHash("uid"+uid,"hashid"+hashid ,"time"+time),Constans.ANDROID_APP_ID,"3",uid+"",hashid);
        toSubscribe(observable, subscriber);
    }
}
